#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <istream>
#include <ranges>
#include <type_traits>

using int64 = int64_t;
using uint64 = uint64_t;

template<class ...Args>
void input(Args&&...args){
    (std::cin>>...>>std::forward<Args>(args));
}

template <class T>
std::remove_cvref_t<T> input(){
    std::remove_cvref_t<T> t;
    std::cin>>t;
    return t;
}

template<class ...Args>
void print(Args&&...args){
    (std::cout<<...<<std::forward<Args>(args));
}

const int64 max_n = 5000 + 5;

constexpr std::array<int64, max_n> factors = []()constexpr->std::remove_cvref_t<decltype(factors)>{
    std::remove_cvref_t<decltype(factors)> ret{};
    std::array<bool, ret.size()> fact_bool{};

    for(size_t i{2}; i<fact_bool.size(); i++){
        if(!fact_bool[i]){
            for(size_t j{i+i}; j<fact_bool.size(); j+=i){
                fact_bool[j] = true;
                ret[j] = std::max(ret[j], (int64)i);
            }
        }
    }

    return ret;
}();

int main(){
    std::iostream::sync_with_stdio(false), std::cin.tie(nullptr), std::cout.tie(nullptr);

    const int64 m{input<int64>()}, n{input<int64>()};

    for(const auto &i : std::ranges::views::iota(m, n)){
        print((factors[i]==0?i:factors[i]), ',');
    }
    print((factors[n]==0?n:factors[n]), '\n');

    // print('\n');
}